package algorithms;

/**
 * @功能
 * @创建时间 2020/6/7
 * 1.1.30
 */
public class shuzudo {
    public static void main(String[] args) {
    suz(3);
    }
    public static boolean[][] suz(int n){
        boolean[][] w = new boolean[n][n];
        for (int i=1;i<n;i++)
            for (int j=1;j<n;j++)
                if(gcp(i+1,j+1)==1)
                    w[i][j]=true;
                else w[i][j]=false;
        for (int i=0;i<n;i++) {
            for (int j = 0; j < n; j++) {
                System.out.print(w[i][j]);
            }
            System.out.print("\n");
        }
                return w;

    }
    private static int gcp(int i,int j){
        if(j==0||i==0) return 1;
        int r = i%j;
        // 不互质
        if(r==0){
            return j;
        }
        else
        return gcp(j,r);

    }
}
